module Types where

data Type =
    Boolean     |
    Int         |
    Int2        |
    Int3        |
    Int4        |
    Float       |
    Float2      |
    Float3      |
    Float4      |
    String      |
    Dataset     |
    NoType
    deriving (Eq, Show)

   
type Var = String
type Name = String
type Program = [Function]


data Function = Function {
	funName :: Name,
	funType :: Type,
	funArgs :: [(Var, Type)],
    funBody :: Stmt
} deriving (Eq, Show)


-- function type (arguments and return value)
data FunType = FunType [Type] Type


-- infixl 5 :*
-- infixl 5 :/
-- infixl 4 :+
-- infixl 4 :-


data Expr =
    V Var                   |
	Ci Integer              | 
	C Double                | 
	S String                | 
    Func Name [Expr]        |
    Op Name Expr Expr       |
    Cast Type Expr          |
    Dot Expr Name           |
    T | F                   
    deriving (Eq, Show)


data Stmt =
    TypeDecl Var Type          |
    Assign Var Expr            |
    Return Expr Type           |
    Branch Expr Stmt Stmt      |
    While Expr Stmt            |
    FunDef Function            |
    Group [Stmt]               |
    Break                      |
    Continue                   |
    For Expr Stmt Stmt
    deriving (Eq, Show)



